"""
@name : 游戏
@author : wangaokang
@projectname: pythonProject6
"""
import random
print("开始游戏！退出请按exit，开始金币为1000！")
i = 0
j = 0
a= 1000

while 1:
        if a >= 100:
            i += 1
            num1 = random.randint(1,6) ; num2 = random.randint(1,6) ; num3 = random.randint(1,6)
            sum = num1+ num2+ num3

            if 3 < sum < 10:
                result = '小'
            else:
                result = '大'

                guess = input("请输入你猜大还是猜小：")
            if guess == "exit":
                print("退出游戏")
                break
            elif guess == result:
                print(f"结果正确，结果是{guess}三个色子的数字分别是{num1}、{num2}、{num3}，和为{sum}")
                j += 1
                a += 100
            elif guess != result:
                print(f"你猜错了{guess} 三个色子的数字分别是{num1}、{num2}、{num3}，和为{sum}")
                a -= 100
            else:
                print("你的金豆不足100，请充值！")

print(f"你一共猜了{i-1}，猜对了{j}次，胜率为{j / (i-1)}，你本轮的金豆为{a}")